home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / Coldfusion / coldfusion-60-win-en.exe / main_app_page12.gif < prev    next >
Encoding:
Text File  |  2002-04-08  |  50.2 KB  |  770 lines

  1. ass="CellBody">Windham</div></td>
  2.   </tr>
  3. </table>
  4.  
  5.  
  6.  
  7.  
  8. </p>
  9. <p id="1152734" class="Body">
  10.   <a name="1152734"> </a>Notice that the values inserted in the table were surrounded by single quotation marks. In SQL, you must surround any text or date values with single quotation marks but numeric values are not.
  11. </p>
  12. <p id="1164506" class="Body">
  13.   <a name="1164506"> </a>Alternatively, you can specify the columns for which you want to insert data. This approach lets you insert data to some columns while omitting others. The syntax for this approach is as follows:
  14. </p>
  15. <pre>INSERT INTO table_name (column1, column2,...)
  16. </pre><pre>VALUES (value1, value2,....)
  17. </pre><p id="1152738" class="Body">
  18.   <a name="1152738"> </a>For example, the syntax to add Kaleigh Smith of Windham, with the address unknown, you use the named column approach:
  19. </p>
  20. <pre>INSERT INTO Clients (LastName, FirstName, City)
  21. </pre><pre>VALUES ('Smith', 'Kaleigh', 'Windham')
  22. </pre><p id="1152741" class="Body">
  23.   <a name="1152741"> </a>You used the <code>cfquery</code> tag to execute SQL from ColdFusion. The <code>cfquery</code> tag passes SQL statements to your data source. As described in Chapter 4, a data source stores information about how to connect to an indicated data provider, such as a relational database management system. The data source you established in Chapter 4 stored information on how to access the Compass Travel database. The data source name was called "CompassTravel". 
  24. </p>
  25. <h3 id="1152742" class="Heading3">
  26.   <a name="1152742"> </a>Exercise: insert trip data using SQL INSERT and cfquery
  27. </h3>
  28. <p id="1152743" class="Body">
  29.   <a name="1152743"> </a>In this exercise you will add code to pass the data entered on the Trip Maintenance collection form and insert into the Compass Travel database. To do this, you will be modifying the trip insert action page to use the SQL INSERT statement and the ColdFusion <code>cfquery</code> tag.
  30. </p>
  31. <h4 id="1164543" class="Heading4">
  32.   <a name="1164543"> </a>To add data using SQL INSERT and cfquery:
  33. </h4>
  34. <ol>
  35.  
  36. <li>Open tripeditaction.cfm in the my_app directory in your editor. 
  37.  
  38. </li>
  39. <li>Locate the <code><cfif isOk EQ "Yes"></code> tag near the end of the file. After the <code><H1></code> <code>Trip Added</H1></code> line, add the following code to insert the data from the Form variables into the Trips table:<p class="Note2"><b><i>Tip:    </i></b>  To save time, you can copy this code from the tripsinsertquery.txt file (for Windows users) or from tripinsertqueryunix.txt (for UNIX users) in the solutions directory.
  40.  
  41. <table border="1" cellpadding="5" cellspacing="0">
  42.   <caption></caption>
  43.   <tr valign="top">
  44.     <th align="left"><a name="1170564"> </a><div id="1170564" class="CellHeading">For </div></th>
  45.     <th align="left"><a name="1170566"> </a><div id="1170566" class="CellHeading">Code </div></th>
  46.   </tr>
  47.   <tr valign="top">
  48.     <td align="left"><a name="1170568"> </a><div id="1170568" class="CellBody">Windows users, using MS Access</div></td>
  49.     <td align="left"><pre  class="Preformatted">
  50. <!--- Insert the new  trip record  into the Compass 
  51.     Travel Database --->
  52. <cfquery name="AddTrip" datasource="compasstravel">
  53.     INSERT INTO Trips (tripName, eventType, tripDescription, 
  54.         tripLocation,departureDate, returnDate, price, tripLeader,
  55.         photo, baseCost, numberPeople, depositRequired)
  56.     VALUES ( '#Form.tripName#', #Form.eventType#,
  57.         '#Form.tripDescription#',
  58.         '#Form.tripLocation#','#Form.departureDate#',
  59.         '#Form.returnDate#',
  60.         #Form.price#, '#Form.tripLeader#', '#Form.photo#',
  61.         #Form.baseCost#, #Form.numberPeople#, '#Form.depositRequired#'
  62. </cfquery>
  63. </pre>
  64. </td>
  65.   </tr>
  66.   <tr valign="top">
  67.     <td align="left"><a name="1170572"> </a><div id="1170572" class="CellBody">UNIX users, using Pointbase</div><a name="1170658"> </a><div id="1170658" class="CellBody"><br /></div><a name="1170660"> </a><div id="1170660" class="CellBody"><br /></div></td>
  68.     <td align="left"><pre  class="Preformatted">
  69. <!--- Insert the new  trip record  into the 
  70.     Compass Travel Database --->
  71. <!--- Use local variables to convert dates to JDBC format
  72.     (yyyy-mm-dd) from input format (mm/dd/yyyy) --->
  73. <cfset JDBCdepartureDate = #Right(Form.departureDate,4)# 
  74.     & "-" & #Left(Form.departureDate,2)# & "-" 
  75.     & #Mid(Form.departureDate,4,2)#> 
  76. <cfset JDBCreturnDate = #Right(Form.returnDate,4)# & "-" 
  77.     & #Left(Form.returnDate,2)# & "-" 
  78.     & #Mid(Form.returnDate,4,2)#> 
  79. <cfquery name="AddTrip" datasource="CompassTravel">
  80.     INSERT INTO Trips (tripName, eventType, 
  81.     tripDescription, tripLocation, 
  82.         departureDate, returnDate, price, tripLeader, photo,
  83.         baseCost, numberPeople,    depositRequired)
  84.   VALUES ( '#Form.tripName#', #Form.eventType#, '#Form.tripDescription#',
  85.         '#Form.tripLocation#', Date'#JDBCdepartureDate#',
  86.         Date'#JDBCreturnDate#',
  87.         #Form.price#,'#Form.tripLeader#', '#Form.photo#',
  88.         #Form.baseCost#, #Form.numberPeople#, '#Form.depositRequired#')
  89. </cfquery>
  90. </pre>
  91. </td>
  92.   </tr>
  93. </table>
  94.  
  95.  
  96.  
  97. </p>
  98. </li>
  99. <li>Save the page and test it by opening the <code>tripedit.cfm</code> in your browser.
  100. </li>
  101. <li>In the tripedit.cfm page, fill in the fields with the values in the following figure, then click Save:<p>
  102.   <img src="images/add_updatea2.gif" alt="Image shows picture of fields on the Trip Maintenance page." border="0" hspace="0" vspace="0">
  103. </p><p>After the new trip is written to the database, the following message appears: Trip is added.</p>
  104. </li>
  105. <li>To verify that the save worked, open tripsearch.cfm in the my_app directory in your browser.
  106. </li>
  107. <li>In the Trip Search page, enter Begins With <b>Nor</b> in the Trip Location criterion value in the Search page as in the following figure:<p>
  108.   <img src="images/add_update3.gif" alt="Image shows picture of debugging information appended to the bottom of a form page." border="0" hspace="0" vspace="0">
  109. </p>
  110. </li>
  111. <li>Click Search. <p>The TripResults page appears:</p><p>
  112.   <img src="images/add_updatea.gif" alt="Image shows picture of debugging information appended to the bottom of a form page." border="0" hspace="0" vspace="0">
  113. </p>
  114. </li>
  115. <li>Click the link to the NH White Mountains to display the details of the trip you just added. Verify that all the fields were saved correctly. <p>The following page appears: </p><p>
  116.   <img src="images/add_update4.gif" alt="Image shows picture of Trip Maintenance page." border="0" hspace="0" vspace="0">
  117. </p>
  118. </li>
  119. <li>Click the Delete button to delete this record so that you can reuse the steps 4-8 of this exercise in the next exercise.</li>
  120. </ol>
  121. <h4 id="1155748" class="Heading4">
  122.   <a name="1155748"> </a>Reviewing the code
  123. </h4>
  124. <p id="1164712" class="Body">
  125.   <a name="1164712"> </a>The following table describes the SQL INSERT and cfquery code used to add data:
  126.  
  127. <table border="1" cellpadding="5" cellspacing="0">
  128.   <caption></caption>
  129.   <tr valign="top">
  130.     <th align="left"><a name="1153306"> </a><div id="1153306" class="CellHeading">Code </div></th>
  131.     <th align="left"><a name="1153308"> </a><div id="1153308" class="CellHeading">Explanation</div></th>
  132.   </tr>
  133.   <tr valign="top">
  134.     <td align="left"><pre  class="Preformatted">
  135. <cfquery name="AddTrip"
  136. datasource="CompassTravel">
  137. </pre>
  138. </td>
  139.     <td align="left"><a name="1153312"> </a><div id="1153312" class="CellBody">Using the <code>datasource</code> attribute, <code>cfquery</code> connects to the data source CompassTravel and returns a result set identified by the <code>name</code> attribute. </div></td>
  140.   </tr>
  141.   <tr valign="top">
  142.     <td align="left"><pre  class="Preformatted">
  143. INSERT INTO Trips (TripName,
  144. EventType, tripDescription,
  145. tripLocation, departureDate,
  146. returnDate, price, tripLeader,photo,
  147. baseCost, numberPeople,
  148. depositRequired)
  149.   VALUES ( '#Form.TripName#',
  150. #Form.EventType#,
  151. '#Form.tripDescription#',
  152. '#Form.tripLocation#',
  153. '#Form.departureDate#',
  154. '#Form.returnDate#', #Form.price#,
  155. '#Form.tripLeader#', '#Form.photo#',
  156. #Form.baseCost#, Form.numberPeople#,
  157. '#Form.depositRequired#)
  158.  
  159. </pre>
  160. </td>
  161.     <td align="left"><a name="1153317"> </a><div id="1153317" class="CellBody">The SQL INSERT statement identifies that the data are to be inserted into the Trips table. The table column names are cited in a comma separated list surrounded by parenthesis (<code>TripName</code>, <code>EventType</code>....) after the table name Trips. </div><a name="1153318"> </a><div id="1153318" class="CellBody">The<code> VALUES</code> keyword indicates the list of values that are inserted into the columns in the same order as the columns are specified earlier in the statement. </div><a name="1165103"> </a><div id="1165103" class="CellBody">The values refer to form variables passed from the data entry form to the action page. The variables are surrounded by pound signs; for example, <code>#Form.baseCost#</code>. Additionally, note that if the column data type is a string data type, then the values are surrounded by single quotation marks; for example: '<code>#Form.TripName#'</code>.</div></td>
  162.   </tr>
  163. </table>
  164.  
  165.  
  166.  
  167.  
  168. </p>
  169. <p id="1152777" class="Body">
  170.   <a name="1152777"> </a>For more information about adding data to a database using SQL and <code>cfquery</code>, see <i>Developing ColdFusion MX Applications with CFML</i>. For more information about SQL, consult any SQL primer.
  171. </p>
  172. <h3 id="1152778" class="Heading3">
  173.   <a name="1152778"> </a>Adding data using the simpler, cfinsert approach
  174. </h3>
  175. <p id="1152779" class="Body">
  176.   <a name="1152779"> </a>For those who would prefer not to have to remember SQL syntax to add information to SQL databases, ColdFusion simplifies the coding for inserting SQL rows through the use of the <code>cfinsert</code> tag. As you might expect, the <code>cfinsert</code> tag has <code>datasource</code> and <code>tablename </code>attributes to specify where the data is inserted. The tag also has a <code>formfields</code> attribute to identify which fields to insert. <code>Formfields</code> is a comma-separated list of form fields to insert. If this attribute is not specified, all fields in the form are included in the operation. The following example uses the <code>cfinsert</code> with these attributes:
  177. </p>
  178. <pre><cfinsert datasource="CompassTravel" tablename="Trips" 
  179. </pre><pre>formfields="tripName, eventType, tripDescription, tripLocation, departureDate,
  180. returnDate, price, tripLeader, photo, baseCost, numberPeople,
  181. depositRequired">
  182. </pre><p id="1152782" class="Body">
  183.   <a name="1152782"> </a>The <code>cfinsert </code>tag used in the previous code snippet uses the following attributes:
  184.  
  185. <table border="1" cellpadding="5" cellspacing="0">
  186.   <caption></caption>
  187.   <tr valign="top">
  188.     <th align="left"><a name="1165127"> </a><div id="1165127" class="CellHeading">Attribute</div></th>
  189.     <th align="left"><a name="1165129"> </a><div id="1165129" class="CellHeading">Description</div></th>
  190.   </tr>
  191.   <tr valign="top">
  192.     <td align="left"><a name="1165131"> </a><div id="1165131" class="CellBody">datasource</div></td>
  193.     <td align="left"><a name="1165286"> </a><div id="1165286" class="CellBody">The data source name associated with the database where the data is inserted.</div></td>
  194.   </tr>
  195.   <tr valign="top">
  196.     <td align="left"><a name="1165135"> </a><div id="1165135" class="CellBody">tablename</div></td>
  197.     <td align="left"><a name="1165358"> </a><div id="1165358" class="CellBody">The name of the SQL table within the database where the data are inserted.</div></td>
  198.   </tr>
  199.   <tr valign="top">
  200.     <td align="left"><a name="1165143"> </a><div id="1165143" class="CellBody">formfields</div></td>
  201.     <td align="left"><a name="1165471"> </a><div id="1165471" class="CellBody"> A comma-separated list of form fields to insert.</div></td>
  202.   </tr>
  203. </table>
  204.  
  205.  
  206.  
  207.  
  208. </p>
  209. <h3 id="1152787" class="Heading3">
  210.   <a name="1152787"> </a>Exercise: insert trip data using cfinsert
  211. </h3>
  212. <p id="1152788" class="Body">
  213.   <a name="1152788"> </a>In this exercise, you change the approach the action page uses to insert the data into the database. You will replace the SQL INSERT statement with the <code>cfinsert</code> tag.
  214. </p>
  215. <h4 id="1165803" class="Heading4">
  216.   <a name="1165803"> </a>To add data using cfinsert:
  217. </h4>
  218. <ol>
  219.  
  220. <li>Open tripeditaction.cfm from the my_app directory in your editor and do the following:<ol type="a">
  221.  
  222. <li>Remove the entire AddTrip cfquery that you added in the last exercise (from the beginning <code><cfquery name ="AddTrip" datasource="CompassTravel"></code> tag to the <code></cfquery> </code>end tag).
  223.  
  224. </li>
  225. <li>Add the following <code>cfinsert</code> tag to insert data into the trips table in the same location as the code that you just deleted:<pre>   <cfinsert datasource="CompassTravel" tablename="TRIPS"> 
  226. </pre></li>
  227. </ol>
  228.  
  229.  
  230. </li>
  231. <li>Save the page and test it by opening the tripedit.cfm page in your browser.
  232. </li>
  233. <li>Follow steps 4 through 9 in the previous exercise to verify this approach to inserting new trips.</li>
  234. </ol>
  235. <p id="1155848" class="Body">
  236.   <a name="1155848"> </a>For more information about adding data to a database using the <code>cfinsert</code> tag, see <i>Developing ColdFusion MX Applications with CFML</i>.
  237. </p>
  238. <h2 id="1155859" class="Heading2">
  239.   <a name="1155859"> </a>Updating a SQL row using cfupdate
  240. </h2>
  241. <p id="1155860" class="Body">
  242.   <a name="1155860"> </a>To update an existing SQL row, ColdFusion offers a simple approach for updating SQL rows through the use of the <code>cfupdate</code> tag. Like <code>cfinsert</code>, the <code>cfupdate</code> tag has <code>datasource</code> and <code>tablename </code>attributes to specify where the data is to be inserted. The tag also has a <code>formfields</code> attribute to identify which fields are to be inserted. <code>Formfields</code> is a comma-separated list of form fields to insert. If this attribute is not specified, all fields in the form are included in the operation. 
  243. </p>
  244. <p id="1155999" class="Body">
  245.   <a name="1155999"> </a>All the fields of the tripedit.cfm page have corresponding columns in the Trips table, so you can omit the <code>FormFields</code> attribute for both the <code>cfinsert</code> and <code>cfupdate</code> tags. If the <code>tripID</code> form field is passed from the TripEdit page the cfupdate tag is used otherwise the <code>cfinsert</code> tag is executed. The following example uses the <code>cfupdate</code> and <code>cfinsert</code> without the <code>FormFields</code> attribute:
  246. </p>
  247. <pre><cfif not isdefined("form.tripID")>
  248. </pre><pre>  <cfinsert datasource="CompassTravel" tablename="Trips"> 
  249.     <cflocation url="tripdetail.cfm">
  250.   <cfelse>
  251.   <cfupdate datasource="CompassTravel" tablename="Trips">
  252.     <cflocation url="tripdetail.cfm?ID=#Form.tripID#">
  253. </pre><pre></cfif>
  254. </pre><h4 id="1155944" class="Heading4">
  255.   <a name="1155944"> </a>Reviewing the code
  256. </h4>
  257. <p id="1166010" class="Body">
  258.   <a name="1166010"> </a>The following tables describes the <code>cfinsert </code>and <code>cfupdate </code>code:
  259.  
  260. <table border="1" cellpadding="5" cellspacing="0">
  261.   <caption></caption>
  262.   <tr valign="top">
  263.     <th align="left"><a name="1155931"> </a><div id="1155931" class="CellHeading">Code </div></th>
  264.     <th align="left"><a name="1155933"> </a><div id="1155933" class="CellHeading">Explanation</div></th>
  265.   </tr>
  266.   <tr valign="top">
  267.     <td align="left"><pre  class="Preformatted">
  268. <cfif not isdefined("form.tripID")>
  269.     <cfinsert datasource="CompassTravel"
  270.     tablename="Trips"> 
  271.         <cflocation url="tripdetail.cfm">
  272. <cfelse>
  273. <cfupdate datasource="CompassTravel"
  274.     tablename="Trips">
  275. <cflocation url="tripdetail.cfm?ID=#Form.tripID#">
  276. </cfif>
  277.  
  278. </pre>
  279. </td>
  280.     <td align="left"><a name="1155943"> </a><div id="1155943" class="CellBody">The ColdFusion function <code>IsDefined</code> determines whether the hidden field tripID was passed to the action page from tripedit.cfm. If there is a current trip, the <code>isDefined</code> function returns True. When there is no current trip, the cfif statement is True. When the cfif statement is True , the <code>cfinsert</code> tag executes and the main page displays with the updated trip. If the cfif statement evaluates to False, the cfinsert statement executes and the first trip displays in the main page. </div></td>
  281.   </tr>
  282. </table>
  283.  
  284.  
  285.  
  286.  
  287. </p>
  288. <h3 id="1155868" class="Heading3">
  289.   <a name="1155868"> </a>Exercise: update trip data using cfupdate
  290. </h3>
  291. <p id="1155869" class="Body">
  292.   <a name="1155869"> </a>In this exercise, you will add the code to update the trip data into the database. You will add the <code>cfupdate</code> tag to the tripeditaction.cfm page.
  293. </p>
  294. <h4 id="1166130" class="Heading4">
  295.   <a name="1166130"> </a>To update the database using cfupdate:
  296. </h4>
  297. <ol>
  298.  
  299. <li>In an editor, open tripeditaction3.cfm from the solutions directory.
  300.  
  301. </li>
  302. <li>Review the code to update the database (the last 12 lines of code).
  303. </li>
  304. <li>Verify that the correct photolocation path is specified. This path is specified in the <cfset PhotoLocation = "C:..."> tag. <p>For example, depending on your web server configuration, the photolocation path might be: </p><ul>
  305. <li>For MS Windows systems:
  306. <!--CI--><pre><code>  <cfset PhotoLocation</code>
  307. <code>    "C:\cfusionmx\wwwroot\CFDOCS\getting_started\Photos\"></code>
  308. </pre><p>or</p><code>  <cfset PhotoLocation =</code>
  309. <code>    "C:\Inetpub\wwwroot\CFDOCS\getting_started\Photos\"></code>
  310. <!--CI--></pre></li>
  311. <li>For Linux or Solaris systems:<!--CI--><pre><code>  <cfset PhotoLocation = "/opt/coldfusionmx/wwwroot/cfdocs/</code>
  312. <code>    getting_started/photos/"></code>
  313. </pre><p>or</p><code>  <cfset PhotoLocation = "/<webserverdocroot>/cfdocs/</code>
  314. <code>    getting_started/photos/"></code>
  315. <!--CI--></pre></li>
  316. </ul>
  317. </li>
  318. <li>Save the file as tripeditaction.cfm in the my_app directory. </li>
  319. </ol>
  320. <p id="1155876" class="Body">
  321.   <a name="1155876"> </a>For more information about adding data to a database using the <code>cfupdate</code> tag, see <i>Developing ColdFusion MX Applications with CFML</i>.
  322. </p>
  323. <p id="1154847" class="Body">
  324.   <a name="1154847"> </a>Now that you have built the data entry form adding new and updating existing trips, you will add the logic to link it to the main trip page to test the update logic.
  325. </p>
  326. <h2 id="1154864" class="Heading2">
  327.   <a name="1154864"> </a>Linking the Trip Edit page to the main page
  328. </h2>
  329. <p id="1154874" class="Body">
  330.   <a name="1154874"> </a>As discussed in Lesson 4, the action page for the maintenance buttons on the main page is maintenanceaction.cfm<code>.</code> You previously added code for the Search and Delete buttons. In the next exercise you will insert the code to call tripedit.cfm from maintenance.cfm as follows:
  331. </p>
  332. <pre><!---      EDIT BUTTON       --->  
  333. </pre><pre><cfelseif IsDefined("Form.btnEdit")>
  334.   <cflocation url="tripedit.cfm?ID=#Form.RecordID#">
  335. <!---      ADD BUTTON       --->  
  336. <cfelseif IsDefined("Form.btnAdd")>
  337.   <cflocation url="tripedit.cfm">
  338. </pre><pre></cfif>
  339. </pre><p id="1154862" class="Body">
  340.   <a name="1154862"> </a>Notice that when the user clicks the Add button, the maintenanceaction.cfm navigates to tripedit.cfm passing no arguments. Conversely, when the user clicks the Edit button, the Trip Edit page passes the current record id. The Trip Edit page must handle both cases. When a <code>RecordID</code> is passed on the URL, tripedit.cfm must query the database and fill the form with the data for the corresponding trip. The following code properly initializes the trip edit form:
  341. </p>
  342. <pre><cfif IsDefined("URL.ID")>
  343. </pre><pre>  <cflue in the Sn the user clicks txach ode:el" tablenns, youpre><pre>formfields="tripName, eventType, tripDescri tablenan, tripLocation, 
  344.         departureDate, returnDate, price, tripLea
  345.  
  346.         photo, baseCost, numberPe,ther theablenaFROM insertttttttted("Form.bm:
  347. </p>
  348. <pre><cfif IsDettttWHEREther the= #t.c);
  349.     cfm">
  350. </pre  cfm">tRequired#'Form.Rely tg trips>
  351. <!---   ADD Btted("Form.b>or<pre><pree= '#>  <cfd)
  352.   VALUE ADD Btted("Form.b>or<ormfieldse= #>  <cfdrm.tripNam ADD Btted("Form.b>or<pre>Name, evente= '#>  <cfd)
  353.  ntType#,
  354. '#F ADD Btted("Form.b>or<pre>ode>  <c'#>  <cfd)
  355.  ption#',
  356.  ADD Btted("Form.b>or<->
  357. <cfsett;cfF76"> (#>  <cfdpLocation#',
  358. ,") from inpfif Is Btted("Form.b>or<> 
  359. <cft;cfF76"> (#>  <cfdrtureDate#',") from inpfif Is Btted("Form.b>or<ureDae= #>  <cfd.retur ADD Btted("Form.b>or<pre>ournDat;c'#>  <cfd)
  360.  pprice#,f Is Btted("Form.b>or<u prit;c'#>  <cfdtripLeaf Is Btted("Form.b>or<, tripLee= #>  <cfdexample, f Is Btted("Form.b>or<
  361.         photo, be= #>  <cfdForm.baseCost ADD Btted("Form.b>or<-&gst, numberPet;c'#>  <cfdumberPeople#, '#F url="tripdetail.cfm">
  362.   <>or<pre><pree= 'E ADD Btted("Form.b>or<ormfieldse= '' ADD Btted("Form.b>or<pre>Name, evente= 'E ADD Btted("Form.b>or<ormfieldsIQL INSERre= #>  <cfdrm.tripNam ADDed("Form.b>or<pre>ode>  <c'
  363.  ADD Btted("Form.b>or<->
  364. <cfsetc'
  365.  ADD Btted("Form.b>or<> 
  366. <cf'
  367.  ADD Btted("Form.b>or<ureDae= '' ADD Btted("Form.b>or<pre>ournDat;c',f Is Btted("Form.b>or<u prit;c'af Is Btted("Form.b>or<, tripLee= 'af Is Btted("Form.b>or<
  368.         photo, be= '
  369.  ADD Btted("Form.b>or<-&gst, numberPet;c''cfm?ID=#Form.tripID#">
  370. </pre><pre></cfif>027</pre><h4 id="1155944" class="Headin0"left"><a name="1155944"> </a>Reviewing the cod1
  371. </h3>
  372. <p id="1152788" class="od1
  373. <
  374.   <a name="1164712"> </a>The followingL INSERT and . The following cod properly initializes update </code>code:
  375.  
  376. <table border="1" cellpadding="5" cellspacing="0">
  377.   <caption></caption>
  378.   <tr valign="top">
  379.     <th align0"left"><a name="11527n0"le</a><div id="1155931" class="CellHeading">Code </div></th>
  380.     <th align0"left"><a name="11527n0"le</a><div id="1155933" class="CellHeading">Explanation</div></th>
  381.   </tr>
  382.   <tr valign="top">
  383.     <td align="left"><pre  class="Pref
  384. </p>
  385. <pre><cfif IsDe")>
  386. </pre><pre>  <cflue in the Sn the user click
  387.  txach ode:el" ta    ns, youpre><pre>formfields="tripName, eventType, tripDescription,
  388. tripLocn, 
  389.         departureDatype, trurnDate, price, tripLeader, photo, baseCost, numberPeo,ther theab    FROM inser                ed("form.tef
  390. </p>
  391. <pre><cfif IsDe        WHEREther the= #t.c);    ID#">
  392. </precfm">tRequired#'lename.Rely tg trips>
  393. <!---   ADD        edForm.b>or<pre><pree= '#>  <cfd)
  394.   VALUE ADD        edForm.b>or<ormfieldse= #>  <cfdrm.tripNam ADD        ed(    Form.b>or<pre>Name, evente= >  <cfd)
  395.  ntType#,
  396. '#F ADD        edForm.b>or<pre>ode>  <c'#>  <cfd)
  397.  ption#',
  398.  ADD        edForm.b>or<->
  399. <cfsett;cfF76"> (#>  <cfdpLocation#',
  400. ,") from inpfif Is        edForm.b>or<> 
  401. <cft;cfF76"> (#>  <cfdrtureDate#',") from inpfif Is        ed...="tripdetail.cfm">
  402. &>or<pre><pree= 'E ADD        edForm.b>or<ormfieldse= 'E ADD        ed...="triprm.tripID#">
  403. </cfif>
  404.  
  405. </pre>
  406. </td>
  407.     <td align04left"><a name="11527n040 </a><div id="1155943" class="CellBody">The ColdFusion function <code>IsDefined</codean thepedit.cfe hidden fiehidderonal tablinvome="1><ier in the statemen620left"><a name="1152n620le</a><div id="1155943" thepedit.cfecode>Recorgumend is passabasevomcorgumenwhen the user csabarselycordID</cotrip displer in the statemen6201eft"><a name="1152n620> </a><div id="11654t handn thecode>Reco, assaba>cfinsert </WHEREt/a>SQL rows thessons, you used the SQL SELECT stablin876"> </a>For mo tag.</li>
  408. <li>he cor. Tgrams a sting SQtinanceps>
  409. <!--- tripeditr Searchrows thesso from er in the statemen6204eft"><a name="1152n620> </a><div id="11527RT statement and t;cfF76"> , the <code>isDef876">  will add"1155999 er in the stateme5523left"><a name="11533523le</a><div id="1170658" class="CellBody"><b35239eft"><a name="115335239e</a><div id="1170658" class="CellBody"><b3524left"><a name="11559324> </a><div id="11654Ifnd is passabadata so remembaapproach is a strineturns Trtheden fiehida1>&lepedit.cf edit datac written ps>
  410. <!---abase w SQtinanso rebasskform fields to insert.</div></td>
  411.   </tr>
  412. </table>
  413.  
  414.  
  415. 6049</p>
  416. <h3 id="1155868" class="Headi6049<
  417.   <a name="115lname="11548 thet qu the user cswith cfquery approac97
  418. </h2>
  419. <p id="1155860" class="Bc97
  420. <
  421.   <a name="1152743"> </a>In thlode> tag thet qu the user csows picture oDcflocord idse and firrent record ialled "Compan.cfm page22
  422. </p>
  423. <h4 id="1166130" class="Headin22">
  424.   <a nalode> tagathet qurip paguser csows picture oDcflocord id data using cfinsert:
  425. </h the Add button, the mn tripeditaction.cfm in the my_app diretory in your editor. 
  426.  
  427. </li>
  428. <li>rm.tripIDdd the <code
  429. </li></code> tag neartory in your br exerciseresponding tripas thblefteery that yatab:m as follows:
  430. </p>
  431. <pre><!---      EDIT BUTtripdetail.c</pre><pre><cfelseif IsDefined("F"Form.btnEdit")>
  432.   <cflocation url="tripedit.cfm?ID=#Form.RecordID#">
  433. <!---      ADD BUTtripdetail.c</pre><pre><cfelseif IsDefined("("Form.btnAdd")>
  434.   <cflocation url  cfm">
  435. </prephotosL/"></c--></pre></li>
  436. </ the Add button, the rtory in your 
  437. </h4>
  438. <ol>4the mn tripeaction3.cfm from th the my_app diretory in your 
  439. </h4l>
  440. </lilowi
  441. <!-- the ttripeditaction3.cfm from thee>cfquery</codC save 152699tag pal tablinwi
  442. <!-- the t qudenT statblefteery t the file. TMLipIDdd the <codeirowser.
  443. </li>4to the tripedi/pre></li>
  444. </ul>
  445. </li>
  446. <li>Saveile as tripeditaction.cfm in s: Trip is adde marip page to  the page and test i;cflocationing the tripedit.cfmectory e and tee="1164712">e coand do the following:">
  447. </p>
  448.  the user cectory in your edDoue </n page topal tabl.</li>
  449. <li>h"0" vspace="0">
  450. </p
  451. <o inserting new e my_app directory. </l940
  452. </pre><p id="1152741" class="B940
  453.  
  454.   <a namRT statement and thse using the <verify te iss a simple aaues are e passmpassrip pagsCT ral e passsolumn es are suromhe database sert actionuery tag and theolum269ju>isDefse antabase using SQL andcations with CFML</i>3"> </a><div id="1155859" class="Headin3"left"><ationuip pagpage to the main pa343
  455. </ol>
  456. <p id="1155876" class="B343
  457. <
  458.   <a name="1uery tag and theorip pas></ln thissstatemeninserts new rows into a r must understauery tag and theolx for this approach is as uery tap>
  459. <pre>INSETge havepre>IN=appr_ dataID=#Form.tripWHEREt/ havepre>IN=as yo_ dataID=#Form.tt;/cfif&g0
  460. </h3>
  461. <p id="1152743" class="Bg0
  462. <
  463.   <aC3.ciolumnme="1152669"> </a>The database11548 table named Clients contains information about people in the following rows:
  464.  
  465. <table border="1" cellpadding="5" cellspacing="0">
  466.   <caption></caption>
  467.   <tr valign="top">
  468.     <th aligg0left"><a name="11533g0le</a><div id="1155933"Person. Wh"CellHeading">Code </div></th>
  469.     <th aligg08eft"><a name="11533g08 </a><div id="1152702" class="CellHeading">LastName</div></th>
  470.     <th alig4050eft"><a name="11533g050 </a><div id="1152704" class="CellHeading">FirstName</div></th>
  471.     <th aligg052eft"><a name="11533g05le</a><div id="1155933"Agess="CellHeading">City</div></th>
  472.   </tr>
  473.   <tr valign="top">
  474.     <td aligg054eft"><a name="11533g05> </a><div id="115271CellBody">14 Greenway</div></td>
  475.     <td aligg05left"><a name="11533g056 </a><div id="1152720" class="CellBody">Green</div></td>
  476.     <td aligg058eft"><a name="11533g0"> </a><div id="1165350" class="CellBody">Tom</div></td>
  477.     <td alig4060eft"><a name="11533g0"> </a><div id="1170612s="CellBody">New York</div></td>
  478.   </tr>
  479.   <tr valign="top">
  480.     <td aligg0"2eft"><a name="11533g06> </a><div id="115332 class="CellBody">Tom</div></td>
  481.     <td alig4064eft"><a name="11533g06> </a><div id="11527Wata class="CellBody">Tom</div></td>
  482.     <td alig406left"><a name="11533g066 </a><div id="1152718" class="CellBody">Peter</div></td>
  483.     <td aligg068eft"><a name="11533g0"> </a><div id="1170542s="CellBody">New York</div></td>
  484.   </tr>
  485.   <tr valign="top">
  486.     <td aligg070eft"><a name="11533g07> </a><div id="117063lass="CellBody">Peter</div></td>
  487.     <td aligg072eft"><a name="11533g0"> </a><div id="11705M155gaclass="CellBody">Green</div></td>
  488.     <td aligg074eft"><a name="11533g07> </a><div id="11527Js users, using MS Access</div></td>
  489.     <td aligg07left"><a name="11533g076 </a><div id="1152720rm.TripName#'</code>.</div></td>
  490.   </tr>
  491. </table>
  492.  
  493. g07
  494. </ol>
  495. <p id="1155848" class="Bg07
  496. <
  497.   <a name="1152696"> </a>After the following SQL statement euery tadatabaseSETg class="e= 'Pitt'ID=#Form.tripWHEREtthe= 3ID=#Form.tt;/cfif&g11
  498. </h3>
  499. <p id="1155869" class="Bg11
  500. <
  501.   <a name="1152699"> </a>the table contains the following rows:
  502.  
  503. <table border="1" cellpadding="5" cellspacing="0">
  504.   <caption></caption>
  505.   <tr valign="top">
  506.     <th alig416left"><a name="11559416le</a><div id="1155933"Person. Wh"CellHeading">Code </div></th>
  507.     <th aligg165eft"><a name="115594165 </a><div id="1152702" class="CellHeading">LastName</div></th>
  508.     <th alig4167eft"><a name="115594167 </a><div id="1152704" class="CellHeading">FirstName</div></th>
  509.     <th aligg169eft"><a name="115594169e</a><div id="1155933"Agess="CellHeading">City</div></th>
  510.   </tr>
  511.   <tr valign="top">
  512.     <td aligg1"left"><a name="1165gg1"le</a><div id="115271CellBody">14 Greenway</div></td>
  513.     <td aligg17left"><a name="115594173 </a><div id="1152720" class="CellBody">Green</div></td>
  514.     <td aligg175eft"><a name="115594175 </a><div id="1165350" class="CellBody">Tom</div></td>
  515.     <td alig4177eft"><a name="115594177 </a><div id="1170612s="CellBody">New York</div></td>
  516.   </tr>
  517.   <tr valign="top">
  518.     <td aligg179eft"><a name="115594179 </a><div id="115332 class="CellBody">Tom</div></td>
  519.     <td alig418left"><a name="1165gg181 </a><div id="11527Wata class="CellBody">Tom</div></td>
  520.     <td alig418left"><a name="115594183 </a><div id="1152718" class="CellBody">Peter</div></td>
  521.     <td aligg185eft"><a name="115594185 </a><div id="1170542s="CellBody">New York</div></td>
  522.   </tr>
  523.   <tr valign="top">
  524.     <td aligg187eft"><a name="115594187 </a><div id="117063lass="CellBody">Peter</div></td>
  525.     <td aligg189eft"><a name="115594189 </a><div id="11533Pittlass="CellBody">Peter</div></td>
  526.     <td aligg19left"><a name="1165gg191 </a><div id="11527Js users, using MS Access</div></td>
  527.     <td aligg19left"><a name="115594193 </a><div id="1152720rm.TripName#'</code>.</div></td>
  528.   </tr>
  529. </talt;/cfif&g415
  530. </pre><h4 id="1155944" class="Headi415
  531. <
  532.   <a nameagsCT ral etai/a>Reviewing the c5347
  533. </pre><p id="1154862" class="B347
  534.  
  535.   <a namuery tag and theorip pas> insach for548me tg triin the the uninsert </WHEREt/a>SQLage from tripeno/WHEREt/a>SQL>formry"> </> </a>Aldata isage dispr the end of2696"> </a>After the following SQL statement euery tadatabaseSETgAgee= Agee+ 1ID=#Form.tripWHEREtthe= 3ID=#Form.tt;/cfif&g43
  536. </h3>
  537. <p id="1155869" class="Bg43
  538. <
  539.   <a name="1152699"> </a>the table contains the following rows:
  540.  
  541. <table border="1" cellpadding="5" cellspacing="0">
  542.   <caption></caption>
  543.   <tr valign="top">
  544.     <th ali711"left"><a name="1152711"le</a><div id="1155933"Person. Wh"CellHeading">Code </div></th>
  545.     <th ali711"left"><a name="1152711"le</a><div id="1152702" class="CellHeading">LastName</div></th>
  546.     <th ali711"2eft"><a name="1152711"2 </a><div id="1152704" class="CellHeading">FirstName</div></th>
  547.     <th ali711"4eft"><a name="1152711"4e</a><div id="1155933"Agess="CellHeading">City</div></th>
  548.   </tr>
  549.   <tr valign="top">
  550.     <td ali711"6eft"><a name="1152711"6e</a><div id="115271CellBody">14 Greenway</div></td>
  551.     <td ali711"left"><a name="11527113> </a><div id="1165350" class="CellBody">Tom</div></td>
  552.     <td ali7114left"><a name="115271140 </a><div id="1155920" class="CellBody">Green</div></td>
  553.     <td ali71142eft"><a name="115271142 </a><div id="1170612s="CellBody">New York</div></td>
  554.   </tr>
  555.   <tr valign="top">
  556.     <td ali71144eft"><a name="115271144 </a><div id="115332 class="CellBody">Tom</div></td>
  557.     <td ali71146eft"><a name="115271146 </a><div id="1152718" class="CellBody">Peter</div></td>
  558.     <td ali7114left"><a name="115271148 </a><div id="1155920" class="CellBody">Green</div></td>
  559.     <td ali7115left"><a name="115271150 </a><div id="1170542s="CellBody">New York</div></td>
  560.   </tr>
  561.   <tr valign="top">
  562.     <td ali71152eft"><a name="115271152 </a><div id="117063lass="CellBody">Peter</div></td>
  563.     <td ali71154eft"><a name="11527115> </a><div id="11527Pittlass="CellBody">Peter</div></td>
  564.     <td ali71156eft"><a name="115271156 </a><div id="11527Js users, using MS Access</div></td>
  565.     <td ali7115left"><a name="1152711"> </a><div id="1165321rm.TripName#'</code>.</div></td>
  566.   </tr>
  567. </taldate logic8"> </a><div id="1154864" class="Headin. </div><a name="11multipre e passspage to the main pa30
  568. </h3>
  569. <p id="1152779" class="B30
  570. <
  571.   <a name="11527se using the <place the Serify te igumen</a>Iahe SQLi>Review thEdit page passeame of antabase using SQL andc Al" cs="Cvno ar the TriunameagsCT ral etaieame of an followy issule aaues are 
  572. </prg datace</code> attribute, t stateme="1uery tag and thecation..."> itional15266co a com insert namecrease valu5%ar the > </aissue/a>the table coing SQL INe.cfm as follows Roue="add thecreaseperly 15266ipLeealu5% format (TON       --->
  573. </pre><pre>  <cflue inSname="AddTrip"
  574. datasource=S Acuery tanding SETg, tripLee= , tripLee* 1.05ID=#Form.tripID#">tRequired#')
  575. <able>
  576.  
  577.  
  578. 606
  579. </p>
  580. <h3 id="1152787" class="Headi606
  581. <
  582.   <a name="1155 data to uery tase anusing SQL INSERT and cfque96
  583. </h2>
  584. <p id="1155860" class="B9/></div><a name="1155869"> </a>In thid</codeaauinking thecreasepe page topal ormry"erly 1y 10%ion path kinrucsowslyowscust qut. If tderonal tablnding hows pictureaoping Coldion pat152743"> ate4.ghnameQLi>Reviemn abe="115266rclass=le aaues are e="1uery tag and theoSQL INSERT statement and the ColdFusion <code>cfquery</code> ta6315</p>
  585. <h4 id="1166130" class="Headin315<
  586.   <a name="116multipre e="115266rclass=le a to uery tase anusing Stabase using cfupdate:
  587. </h4>
  588. <ol>
  589.  
  590. <laappro
  591. </li>
  592. <i>To itehidde tohecreaseile as tripeditaction.cfm in s:olutions directl typn abatabase (the me="11548_app direcf thet; </code>end tag).
  593.  
  594. </li>
  595. <code>m as follows:Roue="add thecreaseperly ge top1y 10%ss 
  596.     Travel Database --->>  <cflue inSname="AddTrip"
  597. datasource=S Acuery tatding SETgureDae= ureDae* 1.1recfm">tRequired#'el Datouepu"/< Npro
  598. reDa--abasnnams teffcfm.cfm">ouepu"/<rephotosL/"></c--></pre></li>
  599. </
  600.  
  601.  
  602. </li a stre main t
  603. </li1y y e and tee="1164712">e coand do the following:    Usepe paage shows pictureaoping Coldeactiake/code>al tablge topal n aberly 1y ame="1155t i;cflocationof andit.cfm pas: Trip is adde mathe page and tede tohecreaseile ing the tripedit.cfm on path kinautoliendatayorip pas>d tede toseirowser.
  604. <nserted s: Trip is adUsepe paage shows pictureaoping Coldeact.</p>
  605. </li>
  606. <labase suows ufulfollocrease vn page topal tablerly 1y 10%ionory in is,maintenane>cfupdate</;cflocation>
  607. <ltor. 
  608.  
  609. <y the detcodeinser.
  610. < 4ahe cor.  topal tais
  611. </p><p>Annam10%shighfm  inserting new e my_app direcldate logi2.
  612. </p>
  613. <h2 id="1155859" class="Headi2g2">
  614.   <aSumma SQL INto the main pa286
  615. </pre><p id="1152741" class="B286
  616. div><a name="1l</a>As detuse vn patribute for both the <code>cfinsert</code> and <codeo rememba qurip pagrmation abody">The ata inbe insevetuse vn pationuery tag and theolum269ju>isDefse ann patribute e ColdFusion <coion effcfm an rly ge tophecreasepss a insach forresponding columuded in the operatio946
  617. </h2>
  618. <p id="1154874" class="B946
  619. <div><aY4847"> <co">te vn paG/</cod S
  620. <cod tutorialata inate </a therw SQdghnam the Trico"b="adMX Aba quody">oid</codeapowerfuleaoping Coldmust hanco"&ar source nra.baseCosid</code theomethodation to SQL dhelppecife vn pad</code theoorrhribesrafple aaue="115266action3.batk 
  621.  
  622. <onformatiis
  623. <utorialatctlarkolu arhnaormr; tag. <p>For eli><p direireIDEme="115484un the d</codeaaoping Coldm,6muchpal tablSeriormatiis
  624. <utoriale Tribinautogenecode> s=le a/a>No-iefsezardatittribuatabases, ColdFd</code theoprows u<ormfme="1cations with CFML</61"4e</a><div id="1154874" class="B61"4eft"><aations winame/a><divaintenaold hspaiv></td>iv></td>
  625.   tion a hspaide/a><divcopfluwidth="90%"s</div></td></td>
  626.   tion a Annarans wia href="../copfr pho.htm"dC sar pho © 2002,shocrom<p a Incc Alnsa pho="CeoLoca theaipName#'cess</div><a pholuwidth="10%"s/td>
  627.   tion a Annarans wia href="
  628.   <img s.html
  629.  IMGages/aPm<code>rip Maintenance pho="16 <ars: ../</p><p>iform/backc="imawidth="16ef"><aatia href="
  630.   <img s.html
  631.  IMGages/aUprip Maintenance pho="16 <ars: ../</p><p>iform/u>/coc="imawidth="16ef">Aaatia href="gete>
  632. <codIX.html
  633.  IMGages/aNextrip Maintenance pho="16 <ars: ../</p><p>iform/letec="imawidth="16ef"><aatia href="../dochom<.htm" corget="_</tr> IMGages/aHom<rip Maintenance pho="16 <ars: ../</p><p>iform/hom<.="imawidth="16ef"><aatia href="javaType#,:</t.perdido.docit.cf ave wolopiet.makeA>The ();r> IMGages/ay adderip Maintenance pho="16 <ars: ../</p><p>iform/ave wor="imawidth="16ef"><aatiName#'code>.</div></td>rm.Tripas: NtoddTt.cfm INto thFORM ACTION="http:/e mca ocs.macrom<p a.co">mxbservG/</cod_S
  634. <cod_Ba>N<p>F_on to SQL _MX_loping ColdF>
  635.   <img s2.jsp" corget="_ mca ocs hspaINPUT TYPE/ayubmitri"Cell="Vry.cdTt.cfmor eLmcaDocs  ALT="Vry.cdTt.cfmor eLmcaDocs td>rmFORM; 
  636. </prebid=td>rmhtmltd>r?xmlt.</SQL ="1.nanenusion ="ISO-8g2"-1"?ireclelp_bookon, t="G/</cod_S
  637. <cod_Ba>N<p>F_on to SQL _MX_loping ColdF">G/</cod S
  638. <cod Ba>N<p>Fag, see <i>Developing ColdFreclelp_h ki>2699tag .htmrmhelp_h ki>reclelp_to vo the="leace">Aontain patBookreclelp_h ki titled">ontain patBook">p"leace.htmlrmhelp_h ki>reclelp_h ki titled"e</codeer"Ceoname=s  ">p"leace2.htmlrmhelp_h ki>reclelp_h ki titled">ontaihocrom<p a g, see <i>Devedocit.cf Colde ">p"leace3.htmlrmhelp_h ki>reclelp_h ki titled"G/</cod answL ro ">p"leace4.htmlrmhelp_h ki>reclelp_h ki titled"C699"c/cod hocrom<p a  ">p"leace5.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo the=
  639. <c">WelcdT the g, see <i>Dreclelp_h ki titled"WelcdT the g, see <i>D">p
  640. <c_onf.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo theChapter"a ntroducp>Fag, see <i>Devreclelp_h ki titled" ntroducp>Fag, see <i>Dev">intro.htmlrmhelp_h ki>reclelp_h ki titled"43" tn" cset sourcelnanso echnoe to=s  ">intro2.htmlrmhelp_h ki>reclelp_h ki titled"W Addisag, see <i>Dev?  ">intro3.htmlrmhelp_h ki>reclelp_h ki titled"12" clg, see <i>Deveurce hocrom<p a Fa><hDeve ">intro4.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo theChapter"aMX AbBasicsDreclelp_h ki titled"MX AbBasicsD"te ml_basics.htmlrmhelp_h ki>reclelp_h ki titled"Weri" clsion M, see <i>Dh kis  ">e ml_basics2.htmlrmhelp_h ki>reclelp_h ki titled"Utherw SQd" clgX Abelet.cfmo ">e ml_basics3.htmlrmhelp_h ki>reclelp_h ki titled"Weri" clsion MX Abexp"lssn3.cf ">e ml_basics4.htmlrmhelp_h ki>reclelp_h ki titled"Utherw SQd" clc dataseCosiprows u" clf ">e ml_basics5.htmlrmhelp_h ki>reclelp_h ki titled"Prows u" clatabarmati ">e ml_basics6.htmlrmhelp_h ki>reclelp_h ki titled"C6Tt.cf" cltripethe m ">e ml_basics7.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo theChapter"aD="115266F that.cf lsDreclelp_h ki titled"D="115266F that.cf lsD">db_basics.htmlrmhelp_h ki>reclelp_h ki titled"Utherw SQd" cle="115266basics D">db_basics2.htmlrmhelp_h ki>reclelp_h ki titled">ontaiody"D">db_basics3.htmlrmhelp_h ki>reclelp_h ki titled"12" clody"sion M, see <i>DD">db_basics4.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo theChapter"aM on you" clYripeD</code theoEnviron thereclelp_h ki titled"C69n you" clYripeD</code theoEnviron the">g on y_d</_env.htmlrmhelp_h ki>reclelp_h ki titled"f codee and tesutoriale
  641. </listructionm ">e on y_d</_env2.htmlrmhelp_h ki>reclelp_h ki titled"C69n you" cle="115266<code>cnts ctoryebuggp>Forptn3.cf ">e on y_d</_env3.htmlrmhelp_h ki>reclelp_h ki titled"hocrom<p a d</code theoenviron thetheolcf ">e on y_d</_env4.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo the=
  642. <c">Ba>N<p>Faa g, see <i>Dloping Coldreclelp_h ki titled"Ba>N<p>Faa g, see <i>Dloping Cold">p
  643. <c_two.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo the </a>A">="lp
  644. <e ando Ba>N<vn patted. Tloping Coldreclelp_h ki titled"="lp
  645. <e ando Ba>N<vn patted. Tloping Cold">de surtact.htmlrmhelp_h ki>reclelp_h ki titled">oping Colded</code theo.
  646. </l ">de surtact2.htmlrmhelp_h ki>reclelp_h ki titled"Dde>IsDee and teaoping Coldeode>isDeal e berPet.cfmo ">de surtact3.htmlrmhelp_h ki>reclelp_h ki titled"Dde>IsDee and termatie berPet.cfmo ">de surtact4.htmlrmhelp_h ki>reclelp_h ki titled"De sure and termatbasepss atripeaoping Colde ">de surtact5.htmlrmhelp_h ki>reclelp_h ki titled"e</code> tao the tldFusioing Colde ">de surtact6.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo the </a>A">Writ" clYripe clas g, see <i>Dloping ColdDreclelp_h ki titled"Writ" clYripe clas g, see <i>Dloping ColdD">/a>Nd_1sttact.htmlrmhelp_h ki>reclelp_h ki titled"Creaf" cltripefclas g, see <i>Dsioing Colde ">/a>Nd_1sttact2.htmlrmhelp_h ki>reclelp_h ki titled"U=le aaue, dinking tis a insertt">/a>Nd_1sttact3.htmlrmhelp_h ki>reclelp_h ki titled"Dd/code> taa ave wo capabilitytt">/a>Nd_1sttact4.htmlrmhelp_h ki>reclelp_h ki titled"Summa Stt">/a>Nd_1sttact5.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo the </a>A">Creaf" clashowsDloping ColdDPit paglelp_h ki titled"Creaf" clashowsDloping ColdDPit "> thetact_h ki.htmlrmhelp_h ki>reclelp_h ki titled"Enhance="1154864"> hows pictureaoping Colde "> thetact_h ki2.htmlrmhelp_h ki>reclelp_h ki titled"Summa Stt"> thetact_h ki3.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo the </a>A">Valiame="11Dmation Eed CureBs=les u<Rulesreclelp_h ki titled"faliame="11Dmation Eed CureBs=les u<Rules">/as_rules.htmlrmhelp_h ki>reclelp_h ki titled"Enhance="1154864"> hows pictureaoping Colde ">/as_rules2.htmlrmhelp_h ki>reclelp_h ki titled"U=le aan  TMLlatabawillollcfm rmati ">/as_rules3.htmlrmhelp_h ki>reclelp_h ki titled"Dd/code> ta you wilvaliamethe datatoreed Curebs=les u<rulesi ">/as_rules4.htmlrmhelp_h ki>reclelp_h ki titled"Summa Stt">/as_rules5.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo the </a>A">ItldFt.cf" cl1548Bach le aand hows pictureD="115266F tcColdFreclelp_h ki titled" tldFt.cf" cl1548Bach le aand hows pictureD="115266F tcColdF">itldFt.cf_dit.cf_ll tripedit.htmlrmhelp_h ki>reclelp_h ki titled"Enhance="1154864"> hows pictureaoping Colde ">itldFt.cf_dit.cf_ll tripedit2.htmlrmhelp_h ki>reclelp_h ki titled"Summa Stt">itldFt.cf_dit.cf_ll tripedit3.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo the </a>A">Athe daand Usimple approD="1reclelp_h ki titled">the daand Usimple approD="1">
  647.   <img s.htmlrmhelp_h ki>reclelp_h ki titled"C6Tpiete="1154864"> hows pictureaoping Colde ">
  648.   <img s2.htmlrmhelp_h ki>rec/lelp_to>reclelp_to vo theIthex">INDEvreclelp_h ki titled" NDEv">gete>
  649. <codIX.htmlrmhelp_h ki>rec/lelp_to>rec/lelp_booked/phDOCTYPE  TMLlPUBLIC "-//W3C//DTD  TMLl4.0864anstaseCos//EN"Dre"http:/ewww.w3.org/TR/REC-html40/loose.dte  cl<htmltd>rheame#'cmedathttp- bervd"C699.cf-elds"52699tag="textmhtml;ln trset=ISO-8g2"-1"e#'cmedat classLASTuery tD"52699tag="04/10/02 17:19:46ef
  650. </prType#, langu ki="JavaSype#,"ed/photHiou JavaSype#,
  651. </p   iti(aintenaor.aopss="e== "Netscape"){);
  652.     docit.cf wn th('<LINK REL=STYLESHEET HREF: ../newton_ns.css" TYPE/atextmcss">'););
  653.     });
  654.  il.c{);
  655.     docit.cf wn th('<LINK REL=STYLESHEET HREF: ../newton_ie.css" TYPE/atextmcss">'););
  656.  });//-->rec/Type#,>recSCRIPT<ars: ../newton.js" vo thetextmjavaType#,ef">SCRIPTe#'ceitle>Writ" clYripe clas g, see <i>Dloping ColdD</eitle>d/photDrecp><spTrica><divhid="111">Writ" clYripe clas g, see <i>Dloping ColdDc/TpTr>ions w -->rec/heame#'cbid=td>rname/a><divaintenaold hspaiv></td>iv></td>
  657.   tion a hspaidewidth="90%"s</div></td></td>
  658.   tion a Annarans<em>G/</cod S
  659. <cod Ba>N<p>Fag, see <i>Developing ColdF</em>pName#'cess</div><a pholuwidth="10%"s/td>
  660.   tion a Annarans wia href="de surtact6.html
  661.  IMGages/aPm<code>rip Maintenance pho="16 <ars: ../</p><p>iform/backc="imawidth="16ef"><aatia href="2699tag .htm" corget="_</tr> IMGages/aUprip Maintenance pho="16 <ars: ../</p><p>iform/u>/coc="imawidth="16ef">Aaatia href="/a>Nd_1sttact2.html
  662.  IMGages/aNextrip Maintenance pho="16 <ars: ../</p><p>iform/letec="imawidth="16ef"><aatia href="../dochom<.htm" corget="_</tr> IMGages/aHom<rip Maintenance pho="16 <ars: ../</p><p>iform/hom<.="imawidth="16ef"><aatia href="javaType#,:</t.perdido.docit.cf ave wolopiet.makeA>The ();r> IMGages/ay adderip Maintenance pho="16 <ars: ../</p><p>iform/ave wor="imawidth="16ef"><aatiName#'code>.</trs</div></td></td>
  663.   </tr>
  664. aide/o" ce
  665.   2  cl<hraatiName#'code>.</div></td>rm.Tripa<h1h CFML<4100ing="74" class="4100ing
  666.   <a </a>As258" clWrit" clYripe clas g, see <i>Dloping ColdDc/h1f
  667. </prth CFML06065
  668. </ol>
  669. <p id="1155876" class=06065
  670. <div><a name="1l</a>A </a>It exeve 15269structting Saa g, see <i>De, daoping Coldeo form wfictttthrouco"&anytionTrip" 
  671. datahe cor152743">sormatiis
  672. l</a>Asguiou /a>Ior updating .
  673. </le (treaf" cle Coisert statabname <ve wo ss a tory and tn rly  SQL " clmed Clients ttripeditonTrip" 
  674. dataserts new roe trip daations with CFML</235
  675. </ol>
  676. <p id="1155876" class="B235
  677. <
  678.   <a nis
  679. l</a>Aseclas> </hnameQLdond tee="1164712">e coations wi path migC69structaa L, tripQL SELECT smed Clients ttripaoe trip daation your edD</codeaau<ve wo ss bawilaccept Convern the t. Trip is adUsepdy clicuody">oi/a>Ndaauflexiollo<ve wo  from ern your edD</codeaaur Searchss bawily and tn ditr Searpal tablave worode>
  680. <!--CIalt;/cfif&g2365</p>
  681. <h4 id="1166130" class="Headg2365<
  682.   <aC3 see <i>Dcodeot sta tcColdF introducfinsert is
  683. l</a>A/a>Reviewing the c7263
  684. </pre><p id="1152741" class="7263
  685.  
  686.   <a name="1164712"> </aiQL INSERs INSERT statemencodeot sta tcColdF e="115484un trmatiis
  687. l</a>As>oi/a>Ndatripefclas g, see <i>Dsioing Coldns the following rows:
  688.  
  689. <table border="1" cellpadding="5" cellspacing="0">
  690.   <caption></caption>
  691.   <tr valign="top">
  692.     <th ali72634eft"><a name="115272634e</a><div id="1155933" dFt.cfellHeading">FirstName</div></th>
  693.     <th ali72636eft"><a name="11527263le</a><div id="1155933"eldsellHeading">FirstName</div></th>
  694.     <th ali72638eft"><a name="11527263le</a><div id="1155933"ntType#,
  695. 'lHeading">Explanation</div></th>
  696.   </tr>
  697.   <tr valign="top">
  698.     <td align="left"><pre  clPCeoLocaSs areQuotesrec;
  699. </cfif>
  700.  
  701. </pre>
  702. </td>
  703.     <td ali72642eft"><a name="115272642e</a><div id="116536F tcColdsers, using MS Access</div></td>
  704.     <td ali72644eft"><a name="115272644 </a><div id="11533Ent;!---/a>Ioo4un tes are 
  705. of Coldelarksorma
  706. <!--->cfinser>After the fos.s="CellBody">New York</div></td>
  707.   </tr>
  708.   <tr valign="top">
  709.     <td align="left"><pre  clgtouepu"rec;
  710. </cfif>
  711.  
  712. </pre>
  713. </td>
  714.     <td ali72648eft"><a name="115272648 </a><div id="11559Tagsers, using MS Access</div></td>
  715.     <td ali7265left"><a name="11527265le</a><div id="11654I9structs tablavendinme <hnameditr Searchrow
  716. <!--,ta tcColdF,eiretext e="11specified. Thbetwe</h4l>tribute ouepu"ng the <plarttatoreedncode.s="CellBody">New York</div></td>
  717.   </tr>
  718.   <tr valign="top">
  719.     <td align="left"><pre  clgting SQL I
  720. </cfif>
  721.  
  722. </pre>
  723. </td>
  724.     <td ali72654eft"><a name="11527265> </a><div id="11527Tagsers, using MS Access</div></td>
  725.     <td ali72656eft"><a name="115272656 </a><div id="11527yubmitsr>After the fosion abJDBChe datoname=.s="CellBody">New York</div></td>
  726.   </tr>
  727.   <tr valign="top">
  728.     <td align="left"><pre  clgtifQL I
  729. </cfif>
  730.  
  731. </pre>
  732. </td>
  733.     <td ali7266left"><a name="1152726"> </a><div id="11706Tagsers, using MS Access</div></td>
  734.     <td ali72662eft"><a name="11527266> </a><div id="11533Creafeslc dataseCosier the fos.s="CellBody">New York</div></td>
  735.   </tr>
  736.   <tr valign="top">
  737.     <td align="left"><pre  clgtse"rec;
  738. </cfif>
  739.  
  740. </pre>
  741. </td>
  742.     <td ali72666eft"><a name="115272666 </a><div id="11527Tagsers, using MS Access</div></td>
  743.     <td ali72668eft"><a name="1152726"> </a><div id="11705><pre>saa g, see <i>D
  744. <!-with the 
  745. <!-s</readyding nF,etribute se"ng the <CeoLosidd the logcified. Th dataform fields to insert.</div></td>
  746.   </tr>
  747. </taname/a><divaintenaold hspaiv></td>iv></td>
  748.   tion a hspaide/a><divcopfluwidth="90%"s</div></td></td>
  749.   tion a Annarans wia href="../copfr pho.htm"dC sar pho © 2002,shocrom<p a Incc Alnsa pho="CeoLoca theaipName#'cess</div><a pholuwidth="10%"s/td>
  750.   tion a Annarans wia href="de surtact6.html
  751.  IMGages/aPm<code>rip Maintenance pho="16 <ars: ../</p><p>iform/backc="imawidth="16ef"><aatia href="2699tag .htm" corget="_</tr> IMGages/aUprip Maintenance pho="16 <ars: ../</p><p>iform/u>/coc="imawidth="16ef">Aaatia href="/a>Nd_1sttact2.html
  752.  IMGages/aNextrip Maintenance pho="16 <ars: ../</p><p>iform/letec="imawidth="16ef"><aatia href="../dochom<.htm" corget="_</tr> IMGages/aHom<rip Maintenance pho="16 <ars: ../</p><p>iform/hom<.="imawidth="16ef"><aatia href="javaType#,:</t.perdido.docit.cf ave wolopiet.makeA>The ();r> IMGages/ay adderip Maintenance pho="16 <ars: ../</p><p>iform/ave wor="imawidth="16ef"><aatiName#'code>.</div></td>rm.Tripas: NtoddTt.cfm INto thFORM ACTION="http:/e mca ocs.macrom<p a.co">mxbservG/</cod_S
  753. <cod_Ba>N<p>F_on to SQL _MX_loping ColdF>/a>Nd_1sttact.jsp" corget="_ mca ocs hspaINPUT TYPE/ayubmitri"Cell="Vry.cdTt.cfmor eLmcaDocs  ALT="Vry.cdTt.cfmor eLmcaDocs td>rmFORM; 
  754. </prebid=td>rmhtmltd>rhDOCTYPE  TMLlPUBLIC "-//W3C//DTD  TMLl4.0864anstaseCos//EN"Dre"http:/ewww.w3.org/TR/REC-html40/loose.dte  cl<htmltd>rheame#'cmedathttp- bervd"C699.cf-elds"52699tag="textmhtml;ln trset=ISO-8g2"-1"e#'cmedat classLASTuery tD"52699tag="04/10/02 17:19:46ef
  755. </prSCRIPT<ars: ../newton.js" vo thetextmjavaType#,ef">SCRIPTe#'cType#, langu ki="JavaSype#,"ed/photHiou JavaSype#,
  756. </p   iti(aintenaor.aopss="e== "Netscape"){);
  757.     docit.cf wn th('<LINK REL=STYLESHEET HREF: ../newton_ns.css" TYPE/atextmcss">'););
  758.     });
  759.  il.c{);
  760.     docit.cf wn th('<LINK REL=STYLESHEET HREF: ../newton_ie.css" TYPE/atextmcss">'););
  761.  });//-->rec/Type#,>receitle>Creaf" cltripefclas g, see <i>Dsioing Colde </eitle>d/photDrecp><spTrica><divhid="111">Creaf" cltripefclas g, see <i>Dsioing Colde </TpTr>ions w -->rec/heame#'cbid=td>rname/a><divaintenaold hspaiv></td>iv></td>
  762.   tion a hspaidewidth="90%"s</div></td></td>
  763.   tion a Annarans<em>G/</cod S
  764. <cod Ba>N<p>Fag, see <i>Developing ColdF><a p</td>rm.Trh="10%"s/td>
  765.   tion a Annarans wia href="de surtact6.html
  766.  IMelp_h ki>reclelp_hip Maintenance pho="16 <ars: ../</p><p>iform/backc="imawidth="16ef"><aatia href="2699tag .htm" corget=elp_h ki>reclelp_hip MaintenanUp One Leablen <ars: ../</p><p>iform/u>/coc="imawidth="16ef">Aaatia href="/a>Nd_1sttact2.html
  767.  IMGages/aNex3rip Maintenance pho="16 <ars: ../</p><p>iform/letec="imawidth="16ef"><aatia href="../dochom<.htm" corget="_</tr> IMGages/aHom<rip Maintenance pho="16 <ars: ../</p><p>iform/hom<.="imawidth="16ef"><aatia href="javaType#,:</t.perdido.docit.cf ave wolopiet.makeA>The ();r> IMGages/ay adderip Maintenance pho="16 <ars: ../</p><p>iform/ave wor="imawidth="16ef"><aatiName#'code>.</trs</div></td></td>
  768.   </tr>
  769. aide/o" ce
  770.   2  cl<